import React, {Component} from 'react'
import {StyleSheet, View, Text, TouchableOpacity} from 'react-native'
import CommonStyle from './style/common.style.js'

import Girl from './Girl.js'

export default class Body extends Component {
    constructor (props) {
        super(props)
        this.state = {
            word: ''
        }
    }
    render () {
        return (
        <View style={[CommonStyle.container]}>
            <Text style={[CommonStyle.text]}>I am a boy</Text>
            <Text style={CommonStyle.text}>{this.state.word ? '获得' + this.state.word: ''}</Text>
            <TouchableOpacity 
                style={CommonStyle.button}
                onPress={() => {
                        this.props.navigator.push({
                            component: Girl,
                            params: {
                                word: '一支玫瑰',
                                callback: word => {
                                    this.setState({word})
                                }
                            }
                        })
                    }}
            >
                <Text style={[CommonStyle.text]}>
                    送女孩一支玫瑰
                </Text>
            </TouchableOpacity>
            
        </View>
        )
    }
}

const styles = StyleSheet.create({
})